﻿using DoNet.Core.Models;
using SqlSugar;
using System.ComponentModel;

namespace DoNet.Bpmn.Models
{
    /// <summary>
    /// 流程节点表，数据实体对象
    /// </summary>
    [SugarTable("Bpmn_Node", "流程节点表")]
    [Serializable]
    public class BpmnNode : TenantEntity, ICreationAudited, IModificationAudited, IDeleteAudited
    {
        /*
        `id`                bigint(20)          NOT NULL AUTO_INCREMENT COMMENT 'id',
        `conf_id`           bigint(20)          NOT NULL COMMENT 'the main conf id',
        `node_id`           varchar(60)         NOT NULL DEFAULT '' COMMENT 'node id',
        `node_type`         int(11)             NOT NULL COMMENT 'its node type,see NodeTypeEnum for detail',
        `node_property`     int(11)             NOT NULL COMMENT 'node property,rules for finding out approvers,see NodePropertyEnum for detail',
        `node_from`         varchar(60)         NOT NULL DEFAULT '' COMMENT 'its prev node',
        `node_froms`        varchar(255)                 DEFAULT NULL COMMENT 'all its prev nodes',
        `batch_status`      int(11)             NOT NULL DEFAULT '0' COMMENT 'can the process approved in batch,0:no,1:Yes',
        `approval_standard` int(11)             NOT NULL DEFAULT '2' COMMENT 'approve standard,current not used',
        `node_name`         varchar(255)                 DEFAULT NULL COMMENT 'node name',
        `node_display_name` varchar(255)                  DEFAULT '' COMMENT 'node display name shown in web or app',
        `annotation`        varchar(255)                 DEFAULT NULL COMMENT 'annotation on this conf',
        `is_deduplication`  int(11)             NOT NULL DEFAULT '0' COMMENT 'whether this node should be deduplicated,0:No,1:Yes',
        `deduplicationExclude` tinyint             default 0                 null comment '0 for no,default value,and 1 for yes',
        `is_dynamicCondition` tinyint default 0  null comment '是否是动态条件节点,0,否,1是',
        `is_parallel`          tinyint          default 0                 null,
        `is_sign_up`        int(11)             NOT NULL DEFAULT '0' COMMENT 'whether this node can be sign up,0:No,1:Yes',
        `remark`            varchar(255)        NOT NULL DEFAULT '' COMMENT 'remark',
        `is_del`            tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '0:No,1:yes',
        `create_user`       varchar(50)                  DEFAULT '' COMMENT 'as its name says',
        `create_time`       timestamp           NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'as its name says',
        `update_user`       varchar(50)                  DEFAULT '' COMMENT 'as its name says',
        `update_time`       timestamp            DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'as its name says', 
        */
        /// <summary>
        /// 获取或设置 编号
        /// </summary>
        [DisplayName("编号")]
        [SugarColumn(IsPrimaryKey = true, ColumnDescription = "编号,主键")]
        public override long Id { get; set; }
        /// <summary>
        /// 
        /// </summary>
        [SugarColumn(ColumnDescription = "")]
        public virtual long ConfigId { get; set; }
        /// <summary>
        /// 流程节点Id
        /// </summary>
        [SugarColumn(ColumnDescription = "流程节点Id")]
        public virtual string NodeId { get; set; } = string.Empty;
        /// <summary>
        /// 审批节点类型，详见NodeTypeEnum
        /// </summary>
        [SugarColumn(ColumnDescription = "审批节点类型")]
        public virtual int NnodeType { get; set; }
        /// <summary>
        /// 审批节点属性，详见NodePropertyEnum
        /// </summary>
        [SugarColumn(ColumnDescription = "审批节点属性")]
        public virtual int NnodeProperty { get; set; }
        /// <summary>
        /// its prev node
        /// </summary>
        [SugarColumn(ColumnDescription = "")]
        public virtual string NodeFrom { get; set; } = string.Empty;
        /// <summary>
        /// all its prev nodes
        /// </summary>
        [SugarColumn(ColumnDescription = "")]
        public virtual string NodeFroms { get; set; } = string.Empty;
        /// <summary>
        /// can the process approved in batch
        /// </summary>
        [SugarColumn(ColumnDescription = "")]
        public virtual bool BatchStatus { get; set; } = false;
        /// <summary>
        /// 批准标准，当前未使用
        /// </summary>
        [SugarColumn(ColumnDescription = "")]
        public virtual int ApprovalStandard { get; set; } = 2;
        /// <summary>
        /// 节点名称
        /// </summary>
        [SugarColumn(ColumnDescription = "节点名称")]
        public virtual string NodeName{ get; set; } = string.Empty;
        /// <summary>
        /// web或应用程序中显示的节点显示名称
        /// </summary>
        [SugarColumn(ColumnDescription = "")]
        public virtual string NodeDisplayName { get; set; } = string.Empty;
        /// <summary>
        /// 注解 annotation on this conf
        /// </summary>
        [SugarColumn(ColumnDescription = "")]
        public virtual string Annotation { get; set; } = string.Empty;
        /// <summary>
        /// whether this node should be deduplicated
        /// </summary>
        [SugarColumn(ColumnDescription = "")]
        public virtual bool IsDeduplication { get; set; } = false;
        /// <summary>
        /// 批准标准，当前未使用
        /// </summary>
        [SugarColumn(ColumnDescription = "")]
        public virtual int DeduplicationExclude { get; set; } = 0;
        /// <summary>
        /// 是否是动态条件节点
        /// </summary>
        [SugarColumn(ColumnDescription = "是否是动态条件节点")]
        public virtual bool IsDynamicCondition { get; set; } = false;
        /// <summary>
        /// 
        /// </summary>
        [SugarColumn(ColumnDescription = "")]
        public virtual bool IsParallel { get; set; } = false;
        /// <summary>
        /// whether this node can be sign up
        /// 此节点是否可以注册
        /// </summary>
        [SugarColumn(ColumnDescription = "")]
        public virtual bool IsSignUp { get; set; } = false;
        /// <summary>
        /// 备注
        /// </summary>
        [SugarColumn(ColumnDescription = "备注")]
        public virtual string Description { get; set; } = string.Empty;

        /// <summary>
        /// 创建日期
        /// </summary>
        [SugarColumn(ColumnDescription = "创建日期")]
        public virtual DateTime? CreatorTime { get; set; }

        /// <summary>
        /// 创建用户主键
        /// </summary>
        [SugarColumn(ColumnDescription = "创建用户主键")]
        public virtual long? CreatorUserId { get; set; }

        /// <summary>
        /// 最后修改时间
        /// </summary>
        [SugarColumn(ColumnDescription = "最后修改时间")]
        public virtual DateTime? LastModifyTime { get; set; }

        /// <summary>
        /// 最后修改用户
        /// </summary>
        [SugarColumn(ColumnDescription = "最后修改用户")]
        public virtual long? LastModifyUserId { get; set; }

        /// <summary>
        /// 删除标志
        /// </summary>
        [SugarColumn(ColumnDescription = "删除标志")]
        public virtual bool DeleteMark { get; set; }

        /// <summary>
        /// 删除时间
        /// </summary>
        [SugarColumn(ColumnDescription = "删除时间")]
        public virtual DateTime? DeleteTime { get; set; }

        /// <summary>
        /// 删除用户
        /// </summary>
        [SugarColumn(ColumnDescription = "删除用户")]
        public virtual long? DeleteUserId { get; set; }
    }
}
